import { Exclude } from 'class-transformer';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotIn, IsString, MaxLength, MinLength } from 'class-validator';

export class UserAllDto {
  @ApiProperty({ type: String, description: '用户昵称', required: false })
  username: string;
  // 隐藏
  @MinLength(4)
  @MaxLength(32)
  @ApiProperty({ type: String, description: '用户登录账号', required: false })
  @IsString()
  @IsNotIn(['', undefined, null], { message: '账号不能为空' })
  account: string;

  @ApiProperty({ type: String, description: '手机号', required: false })
  phoneNum: string;

  @ApiProperty({ type: String, description: '邮箱', required: false })
  email: string;

  @ApiProperty({ type: String, description: '头像url', required: false })
  avatar: string;
  @ApiProperty({
    type: Number,
    description: '删除标记 0-未删除 1-删除',
    default: 0,
    required: false,
  })
  isDelete: number;
  @ApiProperty({
    type: Number,
    description: '帐号类型：0-超管， 1-普通用户',
    default: 1,
    required: false,
  })
  type: number;
  @ApiProperty({
    type: Number,
    description: '所属状态: 1-有效，0-禁用',
    default: 1,
    required: false,
  })
  status: number;
}

export class updateUser extends UserAllDto {
  @ApiProperty({ type: String, description: 'id' })
  id: string;
}
